package wang.aweb.childcar.controller.management;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import wang.aweb.childcar.common.ApiRestResponse;
import wang.aweb.childcar.model.vo.MoneyMealVO;
import wang.aweb.childcar.service.MoneyMealService;

import javax.validation.Valid;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/management/moneyTC/")
public class MoneyTcController {
    @Autowired
    private MoneyMealService moneyMealService;
    @PostMapping("list")
    public ApiRestResponse list(){
        List<MoneyMealVO> moneyMealVOList=moneyMealService.getList();
        return ApiRestResponse.success(moneyMealVOList);
    }
    @PostMapping("disableorEnable")
    public ApiRestResponse disableorEnable(@RequestBody Map<String,Integer> reqMap){
        moneyMealService.disableOrEnable(reqMap.get("id"));
        return ApiRestResponse.success();
    }
//    @PostMapping("add")
//    public ApiRestResponse add(){
//
//    }
}
